1. Field of the Invention
The present invention relates to the recovery of data. More particularly, the present invention relates to the recovery of lost/damaged compression constants in a bitstream of compressed data.
2. Art Background
It is often desirable to compress data, such as video images or sound data, for transmission and storage. Typically, when data is compressed, compression constants are generated. These constants are transmitted or stored along with the compressed image. Problems can arise if the compression constants are lost or damaged prior to decompression of the data. As an illustration, the discussion below illustrates the problems that arise if image data compression constants are lost.
The discrete data points that make up a digital image are known as pixels. Typically, each pixel is represented independently using 8 bits, but other representations also are used for the purposes of compression or analysis. Most of the alternative representations begin by dividing this raw data into disjoint sets. For historical reasons, these sets are referred to as "blocks", even though they may not have a traditional block shape. The alternative representation then characterizes the data by some block-wide information and per-pixel information.
Examples of block-wide information include the minimum pixel value (MIN), the maximum pixel value (MAX), and the dynamic range of the pixel values (DR). Per-pixel information may indicate where the pixel value lies within the range specified by the global information. For compression to be achieved, the per-pixel information must use only a few bits of storage so that the total number of bits used is less than that required to store the raw image.
In one example, the block data is comprised of the MIN, DR and Qbit number (defined below), and the pixel data is comprised of Q codes. A Q code is an integer in the range [0,2.sup.Q -1] that identifies one value in the set {MIN, MIN+1, . . . , MAX}. Since the Qbit number is generally small and the DR value may be relatively large, it is generally not possible to represent all pixel values exactly. Therefore, some quantization error is introduced when pixel values are reduced to Q code values. For instance, if the Qbit number is 3, then it is generally possible to represent 2.sup.3 =8 values from the set {MIN, MIN+1, . . . , MAX} without any error. Pixels with other values are rounded to one of these eight values. This rounding introduces quantization error.
Temporal compression is feasible for a sequence of like images spanning more than one instance in time. An image frame is defined as the 2-dimensional collection of pixels arising within a given time period. It is well known that data from corresponding locations of temporally close image frames is likely to contain similar values. When this is true, compression is improved by encoding each of these like values only once.
In a second example, multiple image frames are encoded by adding a motion flag (MF) to the block information of the first example. This MF indicates whether or not data from each frame is encoded using separate Q codes. If no motion is indicated, the same Q codes are used to represent each frame of data. If motion is indicated, then separate Q codes are used to encode each frame.
If any of the block information is lost, the damage to the image is potentially large since many pixels are affected. For this reason, it is desirable to have techniques for estimating the values of this lost data. For example, if the MF value is damaged, there are two possible interpretations of the input bitstream. One interpretation expects the same Q codes to be used for both frames, and the second interpretation expects the frames to use different Q codes. If the wrong interpretation is chosen, then all the pixels in the block are potentially damaged. Even worse, all the pixels in subsequent blocks could be damaged since the decoder has lost its place in the bitstream. For this reason it is important to have a highly accurate recovery method.
Recovery methods fall into two categories: decoded domain, and encoded domain. Decoded domain techniques restore portions of the image to its raw data format and then exploit local correlation properties to estimate the missing data. Data recovery, including recovery of compression constants, may be performed in the decoded domain. However, additional computation and time, and therefore additional expense, is required to perform and evaluate decodings.